home *** CD-ROM | disk | FTP | other *** search
- on ReallyWantToLeave
- global xWindow
- sound stop 1
- sound stop 2
- showMiaW()
- if objectp(xWindow) then
- tell xWindow
- go(label("Start"))
- end tell
- pause()
- end if
- end
-
- on showMiaW
- global xWindow
- if objectp(xWindow) then
- open(xWindow)
- else
- set xWindow to window "YesNo"
- set the rect of xWindow to getCenteredRect(352, 208)
- set the fileName of xWindow to "YesNo.DIR"
- set the titleVisible of xWindow to 0
- set the modal of xWindow to 1
- open(xWindow)
- end if
- end
-
- on hideMiaW
- global xWindow
- if objectp(xWindow) then
- close(xWindow)
- else
- do("nothing")
- end if
- end
-
- on lose
- global xWindow
- if objectp(xWindow) then
- forget(xWindow)
- end if
- end
-
- on getCenteredRect theRectWidth, theRectHeight
- set theRectLeft to (the stageRight / 2) - (theRectWidth / 2)
- set theRectTop to (the stageBottom / 2) - (theRectHeight / 2)
- return rect(theRectLeft, theRectTop, theRectLeft + theRectWidth, theRectTop + theRectHeight)
- end
-
- on replyYes
- hideMiaW()
- go("Start", "MainMenu.DIR")
- end
-
- on replyNo
- hideMiaW()
- continue()
- end
-
- on checkKeyDown
- set userKey to the key
- if (userKey >= "0") and (userKey <= "9") then
- set the soundLevel to value(userKey)
- end if
- end
-
- on checkKeyEvent whichKey, whichKeyCode
- if the commandDown then
- if whichKey = "Q" then
- showMiaW()
- quit()
- else
- pass()
- exit
- end if
- else
- if whichKeyCode = 27 then
- showMiaW()
- quit()
- else
- if (whichKey = "?") or (whichKey = "/") then
- exit
- else
- if whichKey = "S" then
- set the soundEnabled to not (the soundEnabled)
- exit
- else
- if (whichKey >= "0") and (whichKey <= "9") then
- set the soundEnabled to 1
- set newVolume to value(whichKey) * 28
- set the volume of sound 1 to newVolume
- set the volume of sound 2 to newVolume
- exit
- else
- if whichKeyCode = 29 then
- exit
- else
- if whichKeyCode = 28 then
- exit
- else
- if whichKeyCode = 30 then
- exit
- else
- if whichKeyCode = 31 then
- exit
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- dontPassEvent()
- end
-